package com.bah.tract.client.ui.menu;

import java.awt.Component;
import java.awt.MenuItem;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import com.google.inject.Inject;
import com.google.inject.name.Named;

public class TimeCardMenuItem extends MenuItem {

	private static final class TimeCardActionListener implements ActionListener {
		private final Component timeCard;

		private TimeCardActionListener(Component timeCard) {
			this.timeCard = timeCard;
		}

		@Override
		public void actionPerformed(final ActionEvent e) {
			timeCard.setVisible(true);
		}
	}

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@Inject
	public TimeCardMenuItem(@Named("timeCard") final Component timeCard) {
		super("Show Time Cards");
		addActionListener(new TimeCardActionListener(timeCard));
	}

}
